package cn.sciento.platform.config;


import cn.sciento.common.STongService;
import cn.sciento.core.swagger.ChoerodonRouteData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;

import cn.sciento.swagger.annotation.ChoerodonExtraData;
import cn.sciento.swagger.swagger.extra.ExtraData;
import cn.sciento.swagger.swagger.extra.ExtraDataManager;

/**
 * 服务基本信息
 *
 */
@ChoerodonExtraData
public class PlatformExtraDataManager implements ExtraDataManager {

    @Autowired
    private Environment environment;
    @Override
    public ExtraData getData() {
        ChoerodonRouteData routeData = new ChoerodonRouteData();
        routeData.setName(environment.getProperty("stong.service.current.name", STongService.Platform.CODE));
        routeData.setPath(environment.getProperty("stong.service.current.path", STongService.Platform.PATH));
        routeData.setServiceId(environment.getProperty("stong.service.current.service-name", STongService.Platform.NAME));
        routeData.setPackages("cn.sciento.platform.api,cn.sciento.plugin.platform");
        extraData.put(ExtraData.ZUUL_ROUTE_DATA, routeData);
        return extraData;
    }

}
